<template>
    <!-- 4. 设置轮播图高度 -->
    <swiper :style="{ height: height }" class="carousel" autoplay indicator-dots circular>
        <!-- 3. 列表渲染, 插值显示 -->
        <swiper-item v-for="item in banners" :key="item.id">
            <image class="img" :src="item.imgUrl"></image>
        </swiper-item>
    </swiper>
</template>
  
<script>
export default {
    props: {
        banners: Array,
        height: String,
    },
};
</script>
  
<style scoped>
.carousel {
    height: 100%;
}

.img {
    width: 100%;
}
</style>
  